using System;
using System.Collections;
using System.Text;

using LibrErian.Interfaces.Data;
using Microsoft.Practices.ObjectBuilder;
using Microsoft.Practices.CompositeUI;
using LibrErian.Model;
using LibrErian.Interfaces.Services;

namespace LibrErian.Services
{
    [Service(typeof(ILibraryService))]
    public class LibraryService : ServiceBase, ILibraryService
    {
        public Library GetLibraryById(int libraryId)
        {
            return (Library)DataManager.GetLibraryById(libraryId);
        }

        public IList GetLibraries()
        {
            return DataManager.GetLibraries();
        }

        public void Save(Library library)
        {
            DataManager.SaveOrUpdate(library);
        }

        public void Delete(Library library)
        {
            DataManager.Delete(library);
        }
    }
}
